package com.mf.entity.req.basic;

import java.io.Serial;

import com.mf.groups.GroupsAdminUpdateInterface;
import com.mf.groups.GroupsUpdateInterface;
import com.mf.groups.GroupsAddInterface;
import com.mf.groups.GroupsUserUpdateInterface;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Null;
import jakarta.validation.constraints.Size;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.time.LocalDate;

import lombok.Data;

/**
 * 用户表提交
 */
@Data
public class ReqUser implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;
    @NotNull(message = "id不能为空", groups = {GroupsUpdateInterface.class, GroupsAdminUpdateInterface.class,
            GroupsUserUpdateInterface.class})
    @Null(message = "新增id必须为空", groups = {GroupsAddInterface.class})
    private Integer id;

    @NotBlank(message = "账号不能为空", groups = {GroupsAddInterface.class, GroupsUpdateInterface.class})
    @Size(max = 10, min = 4, message = "账号长度4-10位", groups = {GroupsAddInterface.class, GroupsUpdateInterface.class})
    @Schema(description = "账号")
    private String account;

    @NotBlank(message = "密码不能为空", groups = {GroupsAddInterface.class, GroupsAdminUpdateInterface.class,
            GroupsUserUpdateInterface.class})
    @Null(message = "密码不可修改", groups = {GroupsUpdateInterface.class})
    @Schema(description = "密码")
    private String password;

    @NotBlank(message = "新密码不能为空", groups = {GroupsAdminUpdateInterface.class, GroupsUserUpdateInterface.class})
    private String newPassword;

    @NotBlank(message = "昵称不能为空", groups = {GroupsAddInterface.class, GroupsUpdateInterface.class})
    @Schema(description = "昵称")
    private String nick;

    @NotNull(message = "状态不能为空", groups = {GroupsAddInterface.class, GroupsUpdateInterface.class})
    @Schema(description = "状态,1-启用,0-禁用")
    private Integer status;

    @Schema(description = "备注")
    private String remark;
}
